function Person(name, age) {
    this.name = name
    this.age = age
}

Person.prototype = {
    say: function () {
        console.log('hello')
    },
    back: function () {
        console.log('back')
    }
}

function myNew(fn, ...args) {
    let obj = Object.create(fn.prototype)
    fn.call(obj, ...args)
    return obj
}

let p1 = myNew(Person, 'iverson', 18)
console.log(p1)